package csy.view.memeda.view;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;

/**
 * Created by chengsiyuan on 2017/11/16.
 */

public class PracticePointView extends View {


    private Paint paint1, paint2, paint3;

    public PracticePointView(Context context) {
        super(context);
    }

    public PracticePointView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        paint1 = new Paint();
        paint1.setColor(Color.BLACK);
        paint1.setStrokeCap(Paint.Cap.ROUND);
        paint1.setStrokeWidth(80);
        paint2 = new Paint();
        paint2.setStrokeCap(Paint.Cap.BUTT);
        paint2.setColor(Color.BLACK);
        paint2.setStrokeWidth(80);
        paint3 = new Paint();
        paint3.setColor(Color.BLACK);
        paint3.setStrokeCap(Paint.Cap.SQUARE);
        paint3.setStrokeWidth(30);
    }

    public PracticePointView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public PracticePointView(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        canvas.drawPoint(300, 500, paint1);
        canvas.drawPoint(500, 500, paint2);
        canvas.drawPoint(600, 500, paint3);
    }
}
